"use strict";

exports.__esModule = true;
exports.valueSetter = valueSetter;
var _number = require("../../../helpers/number");
var _utils = require("../../../dataMap/metaManager/utils");
/**
 * Defines what value is set to a numeric-typed cell.
 *
 * @param {*} newValue The value to be set.
 * @returns {*} The new value to be set.
 */
function valueSetter(newValue) {
  if (typeof newValue === 'string' && (0, _number.isNumericLike)(newValue)) {
    const parsedNumber = (0, _number.getParsedNumber)(newValue);
    return (0, _utils.isNullish)(parsedNumber) ? newValue : parsedNumber;
  }
  return newValue;
}